---
title: telemetry
sidebarTitle: telemetry
---

# `prefect.server.services.telemetry`



The Telemetry service.


## Classes

### `Telemetry` <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/services/telemetry.py#L29" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>


Sends anonymous data to Prefect to help us improve

It can be toggled off with the PREFECT_SERVER_ANALYTICS_ENABLED setting.


**Methods:**

#### `enabled` <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/services/telemetry.py#L47" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python
enabled(cls) -> bool
```

#### `environment_variable_name` <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/services/telemetry.py#L43" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python
environment_variable_name(cls) -> str
```

#### `run_once` <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/services/telemetry.py#L98" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python
run_once(self) -> None
```

Sends a heartbeat to the sens-o-matic


#### `run_once` <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/services/base.py#L336" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python
run_once(self) -> None
```

Represents one loop of the service.

Subclasses must override this method.

To actually run the service once, call `LoopService().start(loops=1)`
instead of `LoopService().run_once()`, because this method will not invoke setup
and teardown methods properly.


#### `service_settings` <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/services/telemetry.py#L39" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python
service_settings(cls) -> ServicesBaseSetting
```

#### `start` <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/services/base.py#L218" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python
start(self, loops: None = None) -> NoReturn
```

Run the service indefinitely.


#### `stop` <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/services/base.py#L298" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python
stop(self, block: bool = True) -> None
```

Gracefully stops a running LoopService and optionally blocks until the
service stops.

**Args:**
- `block`: if True, blocks until the service is
finished running. Otherwise it requests a stop and returns but
the service may still be running a final loop.

